Skip to content

Conversation

@mastro993
Copy link
Contributor

@mastro993 mastro993 commented Oct 24, 2025

Short description

This PR refactors the eID issuance state machine to generalize the logic for handling different identification levels. This change improves extensibility and prepares the flow for the upcoming L2+ identification method.

List of changes proposed in this pull request

  • Introduced the EidIssuanceLevel type to define the identification level (and its variations) used during PID issuance. Available values:
    • l2: Documenti su IO issuance using CIE+PIN, CIEID, or SPID
    • l2-fallback: Documenti su IO issuance using CIEID or SPID (fallback mode)
    • l3: IT Wallet issuance using CIE+PIN or CIEID
    • l3-next: IT Wallet issuance using CIE+PIN and L2+ (SPID or CIEID with CIE PACE/Internal auth)
  • Added a level parameter to the eID machine context and the start / restart events, replacing the previous isL3 and isL2Fallback flags.
  • Added isL3IssuanceFeaturesEnabled utility function to determine if the issuance flow is for an L3 or L2 PID
  • start and restart events now require all parameters to be explicitly provided.
  • Updated existing test cases.

Note

l3 and l3-next will be merged once the L2+ flow will become available to all users

How to test

Verify that no regressions are introduced in the following flows:

  • L3 flag disabled
    • Documenti su IO – issuance
    • Documenti su IO – reissuance
  • L3 flag enabled
    • IT Wallet – issuance
    • Documenti su IO – issuance with fallback from IT Wallet

@mastro993 mastro993 self-assigned this Oct 24, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Oct 24, 2025

Jira Pull Request Link

This Pull Request refers to Jira issues:

@github-actions
Copy link
Contributor

PR Title Validation for conventional commit type

All good! PR title follows the conventional commit type.

@mastro993 mastro993 marked this pull request as ready for review October 24, 2025 16:00
@codecov
Copy link

codecov bot commented Oct 25, 2025

Codecov Report

❌ Patch coverage is 68.75000% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.67%. Comparing base (451843f) to head (1057cdd).
⚠️ Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
ts/features/itwallet/machine/eid/actions.ts 0.00% 2 Missing ⚠️
ts/features/itwallet/machine/eid/actors.ts 0.00% 2 Missing ⚠️
...s/itwallet/playgrounds/components/ItwL3Section.tsx 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #7537   +/-   ##
=======================================
  Coverage   59.66%   59.67%           
=======================================
  Files        1859     1860    +1     
  Lines       40313    40313           
  Branches     9257     9314   +57     
=======================================
+ Hits        24053    24055    +2     
+ Misses      16188    16174   -14     
- Partials       72       84   +12     
Files with missing lines Coverage Δ
...ery/components/ItwLegacyDiscoveryInfoComponent.tsx 81.25% <ø> (ø)
...allet/discovery/components/ItwPaywallComponent.tsx 74.13% <100.00%> (ø)
...n/screens/ItwIdentificationModeSelectionScreen.tsx 76.38% <100.00%> (ø)
ts/features/itwallet/machine/eid/context.ts 100.00% <ø> (ø)
ts/features/itwallet/machine/eid/machine.ts 94.33% <100.00%> (+5.05%) ⬆️
ts/features/itwallet/machine/eid/selectors.ts 59.25% <100.00%> (ø)
ts/features/itwallet/machine/eid/utils.ts 100.00% <100.00%> (ø)
...s/itwallet/playgrounds/components/ItwL3Section.tsx 3.70% <0.00%> (ø)
ts/features/itwallet/machine/eid/actions.ts 1.23% <0.00%> (ø)
ts/features/itwallet/machine/eid/actors.ts 2.12% <0.00%> (-0.05%) ⬇️

... and 12 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 451843f...1057cdd. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@ale-mazz ale-mazz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested every requested scenario. LGTM!

Copy link
Collaborator

@RiccardoMolinari95 RiccardoMolinari95 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mastro993 mastro993 added this pull request to the merge queue Nov 5, 2025
Merged via the queue into master with commit 853dfeb Nov 5, 2025
29 checks passed
@mastro993 mastro993 deleted the SIW-3261-add-l2-plus-flow-selection-logic branch November 5, 2025 06:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants